#include "stdafx.h"
#include "JSObj_BaseInfo.h"

CJSObj_BaseInfo::CJSObj_BaseInfo(IWebBrowser2* pWeb)
	: CScriptObject(pWeb)
	, m_lZAType(0)
{
}

CJSObj_BaseInfo::CJSObj_BaseInfo(IWebBrowser2* pWeb, IDispatch* pDisp) 
	: CScriptObject(pWeb, pDisp)
	, m_lZAType(0)
{
	GetAll();
}

void CJSObj_BaseInfo::GetAll()
{
	GetValue(CComBSTR(L"title"), &m_bstrTitle);
	GetValue(CComBSTR(L"zaName"), &m_bstrZAName);
	GetValue(CComBSTR(L"zaType"), &m_lZAType);
	GetValue(CComBSTR(L"zaSex"), &m_bstrZASex);
	GetValue(CComBSTR(L"price"), &m_bstrPrice);
	GetValue(CComBSTR(L"localPhoto"), &m_bstrLocalPhoto);
	GetValue(CComBSTR(L"webPhoto"), &m_bstrWebPhoto);
	GetValue(CComBSTR(L"introduction"), &m_bstrIntroduction);

	GetValue(CComBSTR(L"ayName"), &m_bstrAYName);
	GetValue(CComBSTR(L"userName"), &m_bstrUserName);
	GetValue(CComBSTR(L"phone"), &m_bstrPhone);
	GetValue(CComBSTR(L"mobile"), &m_bstrMobile);
	GetValue(CComBSTR(L"address"), &m_bstrAddress);
	GetValue(CComBSTR(L"website"), &m_bstrWebsite);
	GetValue(CComBSTR(L"contact"), &m_bstrContact);
}

void CJSObj_BaseInfo::SetAll()
{
	SetValue(CComBSTR(L"title"), _variant_t(m_bstrTitle));
	SetValue(CComBSTR(L"zaName"), _variant_t(m_bstrZAName));
	SetValue(CComBSTR(L"zaType"), _variant_t(m_lZAType));
	SetValue(CComBSTR(L"zaSex"), _variant_t(m_bstrZASex));
	SetValue(CComBSTR(L"price"), _variant_t(m_bstrPrice));
	SetValue(CComBSTR(L"localPhoto"), _variant_t(m_bstrLocalPhoto));
	SetValue(CComBSTR(L"webPhoto"), _variant_t(m_bstrWebPhoto));
	SetValue(CComBSTR(L"introduction"), _variant_t(m_bstrIntroduction));
	
	SetValue(CComBSTR(L"ayName"), _variant_t(m_bstrAYName));
	SetValue(CComBSTR(L"userName"), _variant_t(m_bstrUserName));
	SetValue(CComBSTR(L"phone"), _variant_t(m_bstrPhone));
	SetValue(CComBSTR(L"mobile"), _variant_t(m_bstrMobile));
	SetValue(CComBSTR(L"address"), _variant_t(m_bstrAddress));
	SetValue(CComBSTR(L"website"), _variant_t(m_bstrWebsite));
	SetValue(CComBSTR(L"contact"), _variant_t(m_bstrContact));
}
